#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    FILE *fp;
    char string[81];
    if((fp=fopen("test.txt", "w"))==NULL)
    {
        printf("存储空间不够！\n");
        exit(0);
    }
    while(strlen(gets(string))>0)
    {
        fputs(string, fp);
        fputs("\n", fp);
    }
    fclose(fp);
    return 0;
}

